<%-- Created by IntelliJ IDEA. --%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
  <head>
    <title></title>
  </head>
  <body>
  <h1>停车场车位租赁管理系统</h1>
  <form method="post" action="${pageContext.request.contextPath}/rent/findList">
    <tr>
      <td>车牌号：<input type="text" name="carNum" value="${carNum}">
        <button type="submit">搜索</button>
      </td>
    </tr>
  </form>
  <table border="1">
    <tr>
      <td><a href="${pageContext.request.contextPath}/rent/toAdd"><button>车位租赁</button></a> </td>
    </tr>
    <tr>
      <th>租赁人姓名</th>
      <th>车牌号</th>
      <th>租赁状态</th>
      <th>到期日期</th>
      <th>操作</th>
    </tr>
    <c:forEach items="${list}" var="a">
      <tr>
        <td>${a.userName}</td>
        <td>${a.carNum}</td>
        <td>${a.status==0 ? '租赁中':'已到期'}</td>
        <td>${a.maturityDate}</td>
        <td>
          <a href="${pageContext.request.contextPath}/rent/update?id=${a.id}&status=${a.status}">
              ${a.status==0 ? '退租':'已到期'}</a>
        </td>
      </tr>
    </c:forEach>
  </table>
  </body>
</html>